#include<iostream>
#include<vector>

using namespace std;

int mySqrt(int x)
{
    long long left = 0, right = x;
    long long tmp=x;
    long long mid = 0;
    while (left <= right)
    {
        mid = (left + right) / 2;
        if (mid * mid == x)
        {
            return mid;
        }
        else if (mid * mid > x)
        {
            right = mid - 1;
        }
        else if (mid * mid < x)
        {
            left = mid + 1;
        }
    }
    if (mid * mid > x)
        return mid - 1;
    return mid;
}

int main()
{
    int x=0;
    cin>>x;
    cout<<mySqrt(x)<<endl;
    return 0;
}